{
  "$schema": "../01_schema/claude_ui_states.schema.json",
  "project": "Claude Code UI Reconstruction — v10 KIMI FINAL V2",
  "v10_target": "Stronger hook, agent count consistency, stagger ending, timing polish",
  "scenes": [
    {
      "scene_id": "scene_hook_montage",
      "state_type": "hook_montage_state",
      "duration_seconds": 2.5,
      "payload": {
        "flashes": [
          {"icon": "█", "text": "4 Agents · Auto-Fix Pipeline", "color": "orange", "delay": 0.0},
          {"icon": "■", "text": "4 agents running", "color": "orange", "delay": 0.15},
          {"icon": "●", "text": "main · orchestrator", "color": "white", "delay": 0.3},
          {"icon": "◯", "text": "general-purpose · worker", "color": "secondary", "delay": 0.5},
          {"icon": "◯", "text": "code-writer · worker", "color": "secondary", "delay": 0.7},
          {"icon": "◯", "text": "analyst · quality gate", "color": "secondary", "delay": 0.9},
          {"icon": "", "text": "Bash( pipeline )", "color": "blue", "delay": 1.1},
          {"icon": "", "text": "Write( quality_gate.py )", "color": "yellow", "delay": 1.3},
          {"icon": "", "text": "Edit( +12 -3 )", "color": "purple", "delay": 1.5},
          {"icon": "", "text": "Agent finished ✓", "color": "green", "delay": 1.8},
          {"icon": "", "text": "Context compressed 62%", "color": "yellow", "delay": 2.0},
          {"icon": "", "text": "Quality Gate ✓", "color": "green", "delay": 2.2},
          {"icon": "", "text": "89/89 passed", "color": "green", "delay": 2.4}
        ],
        "status_line": "Claude Code UI · Multi-agent pipeline · Zero screen recording"
      }
    },
    {
      "scene_id": "scene_context_compression",
      "state_type": "context_compression_state",
      "duration_seconds": 2.0,
      "payload": {
        "reset_type": "compression",
        "message": "Context compressed: 85k → 32k tokens",
        "old_tokens": 85000,
        "new_tokens": 32000,
        "animation": {
          "countdown_start_frame": 0.1,
          "countdown_duration": 1.0,
          "bar_fill_duration": 1.0
        }
      }
    },
    {
      "scene_id": "scene_multi_agent_launch",
      "state_type": "multi_agent_launch_state",
      "duration_seconds": 3.0,
      "payload": {
        "main_task": {
          "title": "创建交互式总控入口和控制器",
          "elapsed_seconds": 2,
          "tokens": 512,
          "status": "running"
        },
        "subtasks": [
          {"title": "创建交互式总控入口和控制器", "status": "running", "indent": 1},
          {"title": "创建 Amazon 公开产品事实采集脚本", "status": "running", "indent": 1},
          {"title": "创建公开网页产品事实采集脚本", "status": "pending", "indent": 1},
          {"title": "重构总控编排器为7层结构", "status": "pending", "indent": 1}
        ],
        "agents": [
          {"name": "main", "role": "main", "status": "active", "progress": 100, "elapsed_seconds": 47, "tokens": 12300, "final_tokens": 12300, "launch_delay": 0.0},
          {"name": "general-purpose", "role": "worker", "status": "running", "progress": 70, "task": "创建 Amazon 公开产品事实采集脚本...", "elapsed_seconds": 22, "tokens": 23700, "final_tokens": 31400, "launch_delay": 0.5},
          {"name": "code-writer", "role": "worker", "status": "running", "progress": 28, "task": "创建公开网页产品事实采集脚本...", "elapsed_seconds": 15, "tokens": 8200, "final_tokens": 18200, "launch_delay": 1.0},
          {"name": "analyst", "role": "worker", "status": "pending", "progress": 0, "task": "Quality gate validation...", "elapsed_seconds": 0, "tokens": 0, "final_tokens": 10100, "launch_delay": 1.5}
        ],
        "waiting_status": "Waiting for 3 background agents...",
        "animation": {"agent_spawn_interval": 0.8, "progress_speed": 1.0, "subtask_reveal_interval": 0.5}
      }
    },
    {
      "scene_id": "scene_multi_agent_running",
      "state_type": "multi_agent_running_state",
      "duration_seconds": 3.5,
      "payload": {
        "agents": [
          {"name": "main", "role": "main", "status": "active", "progress": 100, "elapsed_seconds": 90, "tokens": 18600},
          {"name": "general-purpose", "role": "worker", "status": "running", "progress_end": 88, "task": "创建 Amazon 公开产品事实采集脚本...", "elapsed_seconds": 67, "tokens": 31400},
          {"name": "code-writer", "role": "worker", "status": "running", "progress_end": 65, "task": "创建公开网页产品事实采集脚本...", "elapsed_seconds": 58, "tokens": 18200},
          {"name": "analyst", "role": "worker", "status": "running", "progress_end": 40, "task": "Quality gate validation...", "elapsed_seconds": 42, "tokens": 10100}
        ],
        "subtasks": [
          {"title": "创建交互式总控入口和控制器", "status": "done", "indent": 1},
          {"title": "创建 Amazon 公开产品事实采集脚本", "status": "running", "indent": 1},
          {"title": "创建公开网页产品事实采集脚本", "status": "running", "indent": 1},
          {"title": "重构总控编排器为7层结构", "status": "pending", "indent": 1}
        ],
        "tool_calls": [
          {"type": "Bash", "status": "completed", "elapsed": "1.2s"},
          {"type": "Read", "status": "completed", "elapsed": "0.8s"},
          {"type": "Write", "status": "completed", "elapsed": "2.1s"}
        ],
        "animation": {"progress_speed": 1.2, "token_growth": true, "elapsed_counter": true, "tool_calls_reveal": true}
      }
    },
    {
      "scene_id": "scene_bash_initial",
      "state_type": "bash_tool_call_state",
      "duration_seconds": 2.5,
      "payload": {
        "tool_name": "Bash",
        "command": "python scripts/run_pipeline.py --mode full",
        "output_lines": [
          {"text": "$ python scripts/run_pipeline.py --mode full", "color": "white"},
          {"text": "[1/5] Loading raw data from CSV...", "color": "dim"},
          {"text": "  OK: 89 candidates loaded", "color": "green"},
          {"text": "[2/5] Validating required fields...", "color": "dim"},
          {"text": "  All 89 candidates have required fields", "color": "green"},
          {"text": "  -> Quality Gate: PASSED (score: 1.0)", "color": "green"},
          {"text": "[3/5] Data enrichment... OK", "color": "green"},
          {"text": "[4/5] Scoring... OK", "color": "green"},
          {"text": "[5/5] Export... TOP20 exported", "color": "green"},
          {"text": "=== SUCCESS: Pipeline completed ===", "color": "green"}
        ],
        "exit_code": 0,
        "status": "completed",
        "elapsed": "2.3s",
        "thought": "Initial pipeline run successful"
      }
    },
    {
      "scene_id": "scene_write_code",
      "state_type": "write_tool_call_state",
      "duration_seconds": 2.5,
      "payload": {
        "tool_name": "Write",
        "file_path": "src/quality_gate.py",
        "total_lines": 10,
        "status": "created",
        "code_lines": [
          "REQUIRED_FIELDS = [\"aweme_id\", \"title\", \"author\",",
          "                  \"link\", \"description\"]",
          "",
          "class QualityGate:",
          "    def validate(self, candidates):",
          "        pass_count = 0",
          "        for c in candidates:",
          "            missing = [f for f in REQUIRED_FIELDS",
          "                      if f not in c or not c[f]]",
          "            if not missing:",
          "                pass_count += 1",
          "        return pass_count / len(candidates)"
        ],
        "key_lines": [0, 7, 8, 10],
        "code_font_size": 26
      }
    },
    {
      "scene_id": "scene_edit_diff",
      "state_type": "edit_diff_tool_state",
      "duration_seconds": 3.0,
      "payload": {
        "tool_name": "Edit",
        "file_path": "src/quality_gate.py",
        "diff_lines_added": 12,
        "diff_lines_removed": 3,
        "diff_preview": [
          {"type": "context", "text": "    for i, c in enumerate(candidates):"},
          {"type": "context", "text": "        missing = []"},
          {"type": "remove", "text": "        if 'link' not in c:"},
          {"type": "add", "text": "        for field in REQUIRED_FIELDS:"},
          {"type": "add", "text": "            if field not in c or not c[f]:"},
          {"type": "add", "text": "                missing.append(field)"},
          {"type": "context", "text": "        if missing:"},
          {"type": "remove", "text": "            self.errors += 1"},
          {"type": "add", "text": "            self._log_error(field, c)"},
          {"type": "add", "text": "            continue"},
          {"type": "context", "text": "        pass_count += 1"}
        ],
        "key_lines_add": [3, 4, 5],
        "diff_font_size": 24
      }
    },
    {
      "scene_id": "scene_fail_quality_gate",
      "state_type": "error_tool_call_state",
      "duration_seconds": 3.5,
      "payload": {
        "tool_name": "Bash",
        "command": "python rebuild_pipeline.py --validate",
        "output_lines": [
          {"text": "$ python rebuild_pipeline.py --validate", "color": "white"},
          {"text": "[1/5] Loading... OK: 89 candidates", "color": "dim"},
          {"text": "[2/5] Validating...", "color": "dim"},
          {"text": "", "color": "dim"},
          {"text": "  ERROR: Missing field 'link' for 12 candidates", "color": "red"},
          {"text": "  ERROR: Missing field 'author' for 5 candidates", "color": "red"},
          {"text": "", "color": "dim"},
          {"text": "  -> Quality Gate: FAILED (score: 0.809)", "color": "red"},
          {"text": "=== FAILED: 0/89 passed quality gate ===", "color": "red"}
        ],
        "exit_code": 1,
        "error_count": 17,
        "error_moment": 0.55,
        "error_title": "QUALITY GATE: FAILED"
      }
    },
    {
      "scene_id": "scene_fix_apply",
      "state_type": "edit_diff_tool_state",
      "duration_seconds": 3.0,
      "payload": {
        "tool_name": "Edit",
        "file_path": "config/thresholds.json",
        "diff_lines_added": 6,
        "diff_lines_removed": 0,
        "diff_preview": [
          {"type": "add", "text": "  \"quality_gate\": {"},
          {"type": "add", "text": "    \"min_score\": 0.85,"},
          {"type": "add", "text": "    \"required_fields\": ["},
          {"type": "add", "text": "      \"aweme_id\", \"title\", \"author\","},
          {"type": "add", "text": "      \"link\", \"description\""},
          {"type": "add", "text": "    ]}"}
        ],
        "fix_header": "FIX: Adding REQUIRED_FIELDS validation",
        "key_lines_add": [0, 1, 2],
        "diff_font_size": 24
      }
    },
    {
      "scene_id": "scene_fix_rerun_pass",
      "state_type": "bash_tool_call_state",
      "duration_seconds": 3.0,
      "payload": {
        "tool_name": "Bash",
        "command": "python rebuild_pipeline.py --validate",
        "output_lines": [
          {"text": "$ python rebuild_pipeline.py --validate", "color": "white"},
          {"text": "[1/5] Loading... OK: 89 candidates", "color": "dim"},
          {"text": "[2/5] Validating...", "color": "dim"},
          {"text": "  All 89 candidates have required fields", "color": "green"},
          {"text": "  -> Quality Gate: PASSED (score: 1.0)", "color": "green"},
          {"text": "[3/5] Data enrichment... OK", "color": "green"},
          {"text": "[4/5] Scoring... OK", "color": "green"},
          {"text": "[5/5] Export... TOP20 exported", "color": "green"},
          {"text": "=== SUCCESS: Pipeline completed ===", "color": "green"}
        ],
        "exit_code": 0,
        "status": "completed",
        "elapsed": "2.1s",
        "thought": "Fix applied, re-running validation...",
        "result_badge": "PASS · All candidates validated"
      }
    },
    {
      "scene_id": "scene_agent_complete",
      "state_type": "agent_complete_state",
      "duration_seconds": 3.0,
      "payload": {
        "agents": [
          {"name": "main", "role": "main", "status": "completed", "progress": 100, "elapsed_seconds": 90, "tokens": 18600},
          {"name": "general-purpose", "role": "worker", "status": "completed", "progress": 100, "tokens": 31400, "elapsed_seconds": 67, "task_done": "Amazon product scraper"},
          {"name": "code-writer", "role": "worker", "status": "completed", "progress": 100, "tokens": 18200, "elapsed_seconds": 58, "task_done": "Web scraper"},
          {"name": "analyst", "role": "worker", "status": "completed", "progress": 100, "tokens": 10100, "elapsed_seconds": 42, "task_done": "Quality gate logic"}
        ],
        "summary": "4 agents · 1m 30s · 78.3k tokens total",
        "file_count": 5,
        "animation": {"agent_complete_interval": 0.3, "summary_reveal": true}
      }
    },
    {
      "scene_id": "scene_final_status",
      "state_type": "final_status_v4_state",
      "duration_seconds": 3.0,
      "payload": {
        "verdict": "PASS",
        "summary": "Pipeline completed · 89 candidates · quality gate passed",
        "stats": [
          {"label": "Files Changed", "value": "5", "icon": "[F]"},
          {"label": "Total Time", "value": "1m 30s", "icon": "⏱"},
          {"label": "Tokens Used", "value": "78.3k", "icon": "⚡"},
          {"label": "Agents Used", "value": "4", "icon": "●"}
        ],
        "badges": [
          {"text": "Auto-fix pipeline", "color": "green"},
          {"text": "Fully automated", "color": "orange"},
          {"text": "reusable", "color": "blue"},
          {"text": "zero recording", "color": "yellow"}
        ],
        "animation": {"verdict_delay": 0.2, "stats_delay": 0.8, "badges_delay": 2.0}
      }
    }
  ]
}
